{extend name="adminheader:header"/}
{block name="content"}
<style type="text/css">
    thead tr th{
        text-align: center;
    }
    tbody tr td{
        text-align: center;
    }
</style>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>订单列表</h5>
                    </div>
                    <div class="ibox-content">
                        <form action="{:url('/admin/Orders/index')}" method="post" role="form" class="form-inline" style="padding-bottom:30px;">
                            订单号: <input type="text" name="o_code" value="{$o_code|default=''}" placeholder="请输入订单号" style="width:150px;" class="form-control" />&nbsp;&nbsp;
                            会员姓名: <input type="text" name="u_name" value="{$u_name|default=''}" placeholder="请输入会员姓名" style="width:150px;" class="form-control" />&nbsp;&nbsp;
                            状态:
                            <select class="form-control" name="o_status">
                                <option value="">全部</option>
                                <option value="1" {if condition="$o_status eq 1"}selected{/if}>未付款</option>
                                <option value="2" {if condition="$o_status eq 2"}selected{/if}>已付款</option>
                                <option value="3" {if condition="$o_status eq 3"}selected{/if}>已取消</option>
                            </select>&nbsp;&nbsp;
                            付款方式:
                            <select class="form-control" name="o_type">
                                <option value="">全部</option>
                                <option value="1" {if condition="$o_type eq 1"}selected{/if}>余额</option>
                                <option value="2" {if condition="$o_type eq 2"}selected{/if}>支付宝</option>
                                <option value="3" {if condition="$o_type eq 3"}selected{/if}>微信</option>
                            </select>&nbsp;&nbsp;
                            物流公司: <input type="text" name="o_company" value="{$o_company|default=''}" placeholder="请输入物流公司" style="width:150px;" class="form-control" />&nbsp;&nbsp;
                            物流单号: <input type="text" name="o_snumber" value="{$o_snumber|default=''}" placeholder="请输入物流单号" style="width:150px;" class="form-control" />
                            <input type="submit" class="btn btn-success" value="搜索" style="margin-bottom: 0;"/>
                            <a class="btn btn-danger" href="{:url('/admin/Orders/index')}">清空</a>
                        </form>
                        <div class="table-responsive">
                            <table class="table table-striped table-hover">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>订单号</th>
                                        <th>会员姓名</th>
                                        <th>订单金额</th>
                                        <th>状态</th>
                                        <th>付款方式</th>
                                        <th>付款时间/取消时间</th>
                                        <th>物流公司</th>
                                        <th>物流单号</th>
                                        <th>会员收货地址</th>
                                        <th>创建时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {if condition="$list neq null"}
                                        {volist name="list" id="vo"}
                                            <tr>
                                                <td>{$vo.id}</td>
                                                <td>{$vo.o_code}</td>
                                                <td>{$vo.u_name}</td>
                                                <td>￥{$vo.o_tprice}</td>
                                                {if condition="$vo.o_status eq 1"}
                                                    <td>未付款</td>
                                                {elseif condition="$vo.o_status eq 2"/}
                                                    <td style="color: #0000FF;">已付款</td>
                                                {elseif condition="$vo.o_status eq 3"/}
                                                    <td style="color: #B00000;">已取消</td>
                                                {/if}
                                                {if condition="$vo.o_type eq 1"}
                                                    <td>余额</td>
                                                {elseif condition="$vo.o_type eq 2"/}
                                                    <td>支付宝</td>
                                                {elseif condition="$vo.o_type eq 3"/}
                                                    <td>微信</td>
                                                {else/}
                                                    <td></td>
                                                {/if}
                                                <td>{:date('Y-m-d H:i',$vo['o_time'])}</td>
                                                <td>{$vo.o_company}</td>
                                                <td>{$vo.o_snumber}</td>
                                                <td>{$vo.a_address}</td>
                                                <td>{:date('Y-m-d H:i',$vo['addtime'])}</td>
                                                <td>
                                                    <a class="btn btn-success infos" id="{$vo.gids}" ocode="{$vo.o_code}" oid="{$vo.id}"/>查看商品</a>
                                                    <a href="{:url('/admin/Orders/edit',array('id'=>$vo['id'],'uid'=>$vo['uid']))}" class="btn btn-primary">编辑</a>
                                                    <a href="{:url('/admin/Orders/delete',array('id'=>$vo['id']))}" class="btn btn-danger js-ajax-delete">删除</a>
                                                </td>
                                            </tr>
                                        {/volist}
                                    {else/}
                                        <tr>
                                            <td style="font-size:20px;text-align:center">暂无数据</td>
                                        </tr>
                                    {/if}
                                </tbody>
                            </table>
                            <div class="text-left pages">
                                {$page}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<script src="/admin/js/admin.js"></script>
<script type="text/javascript">
    /* 查看商品 */
    $('.infos').click(function(){
        var gids = $(this).attr('id');
        var oid = $(this).attr('oid');
        var ocode = $(this).attr('ocode');
        openIframeLayer("{:url('/admin/orders/order_goods')}?id="+oid+"&gids=" + gids, '订单号: '+ocode, {
            area: ['1100px', '500px'],
            yes: function (index, layero) {
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    });
</script>
{/block}